package jedis;

import redis.clients.jedis.Jedis;

import java.util.Set;

/**
 * @author ifonly
 * @version 1.0 2016-02-01 13:58
 * @since JDK 1.6
 */
public class RedisKeyJava {

    public static void main(String[] args) {
        //连接本地的 Redis 服务
        Jedis jedis = new Jedis("localhost");
        System.out.println("Connection to server sucessfully");

        // 获取数据并输出
        Set<String> set = jedis.keys("*");
        for (String s : set) {
            System.out.println("List of stored keys:: " + s);
        }
    }

}
